@extends('wechat.member-layout')

@section('content')
    <div class="container" id="container">
        <div class="bd">
            <article class="weui_article">
                <img src="{{ $wechatUpload->guest_image }}" width="100%">
            </article>
            <form action="" method="post" style="margin-top:-20px;">
                {!! csrf_field() !!}
                <div class="weui_cells_title">设置{{ $wechatUpload->type_word }}信息</div>
                <div class="weui_cells weui_cells_form">
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">标题</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input maxlength="18" class="weui_input" type="text" name="title" placeholder="请准确描述{{ $wechatUpload->type_word }}内容"/>
                        </div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">最小打赏</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input maxlength="18" class="weui_input" type="text" name="min_price" placeholder="输入最小打赏金额"/>
                        </div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">最大打赏</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input maxlength="18" class="weui_input" type="text" name="max_price" placeholder="输入最大打赏金额"/>
                        </div>
                    </div>
                </div>
                <div class="weui_cells_tips">1.请准确填写标题，与{{ $wechatUpload->type_word }}不符会被删除。</div>
                <div class="weui_cells_tips">2.请认真填写打赏金额，一经确认不允许修改。</div>
                <div class="weui_btn_area">
                    <input type="hidden" name="openid" value="{{ $wechatUpload->openid }}"/>
                    <input type="hidden" name="key" value="{{ $wechatUpload->key }}">
                    <input type="hidden" name="id" value="{{ $wechatUpload->id }}">
                    <input class="weui_btn weui_btn_primary" type="submit"/>
                </div>
            </form>
        </div>
    </div>
@endsection


@section('js')
    <script src="http://{{ env('QINIU_DOMAIN') }}/js/zepto.min.js"></script>
    <script>
        $(document).ready(function() {
            $('select').change(function(event) {
                if($(this).val()==0){
                    $('select').after('<input class="weui_input" name="price" min="0" max="10000" placeholder="输入0-10000元"/>');
                    $('select').remove();
                    $('.weui_cell_select').removeClass('weui_cell_select').removeClass('weui_select_after');
                }
            });
        });
    </script>
@endsection